nplb: use SIGUSR2 in KillSendsSignalToSelf - #11335
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the KillSendsSignalToSelf test in starboard/nplb/posix_compliance/posix_signal_test.cc to use SIGUSR2 instead of SIGUSR1 for signal verification. There are no review comments, and I have no feedback to provide.
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
96a3c28 to
8b321ef
Compare
|
Is the behavior of SIGUSR1 documented anywhere by AOSP? I was able to find https://android.googlesource.com/platform/bionic/+/master/tests/signal_test.cpp#398 which leads me to believe it just blocks SIGKILL and SIGSTOP, in which case can we try unblocking them instead of switching to SIGUSR2? Ex: |
|
@sacuff sorry, my change was poorly documented I did the change based on ART's SignalCatcher that sets up handlers for SIGUSR1: https://android.googlesource.com/platform/art/+/refs/heads/main/runtime/signal_catcher.cc#207 and the runtime errors that show that it's being intercepted by it: posix_signal_test already tries to unblock SIGUSR1, so I tried adding SIGKILL and SIGSTOP, but the signal is still being intercepted by the ART's signal catcher. I think one possible solution is to do something similat to the fix of #11340 and make the signal thread-directed in a posix_emu kill() wrapper, so it ART won't have the chance to intercept it, wdty? AFAIU it's a very similar issue |
|
@jellefoks I see SIGUSR1 (and 2) are used for lifecycle stuff. Do you have an opinion on how AOSP should handle the interception here? |
|
I created this as a proposal: #11562 |
sacuff
left a comment
There was a problem hiding this comment.
Discussed the signal usage more with Jelle. SIGUSR1 is used on Linux for lifecycle events, but so is SIGUSR2 so this change should be fine without needing to change of the signal handling on Android.
Not relevant to NPLB: on AOSP we will want to make sure to translate lifecycle events to intents instead of going through the signal route.
SIGUSR1 is intercepted by the Android runtime and never reaches the handler installed by the test. Switch the test to SIGUSR2. Bug: 532068409
8b321ef to
a7e54a2
Compare
SIGUSR1 is intercepted by the Android runtime and never reaches the handler installed by the test. Switch the test to SIGUSR2.
Bug: 532068409